using System;
using System.Collections.Generic;

using SBPweb.Modules.Modularity;
using SBPweb.Contracts.Implementation;

namespace SBPweb.Contracts
{
	/// <summary>
	/// Interface of ILayoutService
	/// </summary>
	public interface ILayoutService : IService, IPersistable
	{
		#region Properties

		/// <summary>
		/// Layout group
		/// </summary>
		LayoutGroup LayoutGroup
		{
			get;
		}

		/// <summary>
		/// Layout provider
		/// </summary>
		ILayoutProvider LayoutProvider
		{
			get;
		}

		/// <summary>
		/// Name of the layout group
		/// </summary>
		string LayoutGroupName
		{
			get;
		}
		
		/// <summary>
		/// Selected layout
		/// </summary>
		string SelectedLayout
		{
			get;
		}

		/// <summary>
		/// Is initialized?
		/// </summary>
		bool IsInitialzed
		{
			get;
		}

		#endregion

		#region Methods

		/// <summary>
		/// Method for initialization
		/// </summary>
		/// <param name="layoutGroupName">layout group name</param>
		void Initialize(string layoutGroupName);
		/// <summary>
		/// Method for terminate
		/// </summary>
		void Terminate();

		/// <summary>
		/// Delete layout
		/// </summary>
		/// <param name="name">layout name</param>
		/// <returns>success</returns>
		bool DeleteLayout(string name);
		/// <summary>
		/// Rename layout
		/// </summary>
		/// <param name="oldName">old name</param>
		/// <param name="newName">new name</param>
		/// <returns>success</returns>
		bool RenameLayout(string oldName, string newName);

		/// <summary>
		/// Save layout
		/// </summary>
		/// <param name="name">layout name</param>
		/// <returns>success</returns>
		bool SaveLayout(string name);
		/// <summary>
		/// Load layout
		/// </summary>
		/// <param name="name">layout name</param>
		/// <returns>success</returns>
        bool LoadLayout(string name);

		#endregion

		#region Events

		/// <summary>
		/// Event for initialization
		/// </summary>
		event EventHandler Initialized;
		/// <summary>
		/// Event for termination
		/// </summary>
		event EventHandler Terminated;
		/// <summary>
		/// Event before layout load
		/// </summary>
		event EventHandler LayoutLoading;
		/// <summary>
		/// Event for layout load
		/// </summary>
		event EventHandler LayoutLoaded;
		/// <summary>
		/// Event for layout save
		/// </summary>
		event EventHandler LayoutSaved;
		/// <summary>
		/// Event for layout rename
		/// </summary>
		event EventHandler LayoutRenamed;
		/// <summary>
		/// Event for layout delete
		/// </summary>
		event EventHandler LayoutDeleted;

		#endregion
	}
}
